import 'raf/polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import { Provider } from 'react-redux';
import App from 'containers/App'
import 'share/common'
import 'styles/icon.less'
import 'styles/common.scss'
import 'styles/themes/index.scss'
import 'styles/animate.css'
import config from 'config'
import 'ant-design-pro/dist/ant-design-pro.css';
import configureStore from 'stores';

const store = configureStore.reduxStore();

/**
 *          ___   ___    ________   ___        _________   _________   _______
 *         /  /  /  /  /  ______/  /  /       /__   __ /  /  ___   /  /  ____/
 *        /  /  /  /  /  /        /  /          /  /     /  /  /  /  /  /
 *       /  /__/  /  /  /_____   /  /          /  /     /  /  /  /  /  /___
 *      /  ___   /  /  ______/  /  /          /  /     /  /  /  /  /___   /
 *     /  /  /  /  /  /        /  /          /  /     /  /  /  /      /  /
 *    /  /  /  /  /  /_____   /  /_____   __/  /__   /  /__/  /  ____/  /
 *   /__/  /__/  /________/  /________/  /_______/  /________/  /______/
 *
 * -------------------------------------------------------------------------
 *
 *                         汇联易中控重构项目入口
 */
const root = document.getElementById("app");
const render = (Component) => {
  ReactDOM.render(
    <AppContainer warnings={false}>
      <Provider store={store}>
        <Component />
      </Provider>
    </AppContainer>,
    root
  )
};

render(App);

if (module.hot) {
  module.hot.accept('./containers/App', () => {
    const NextApp = require('./containers/App').default; // eslint-disable-line global-require
    render(NextApp)
  });
}

console.log(config.appEnv);


